package com.hxl.tech.gateway.core.exception;

import com.hxl.tech.gateway.common.constant.Result;
import lombok.Data;

@Data
public class GatewayException extends RuntimeException {

    private Integer code;

    public GatewayException(Result result) {
        super(result.getMsg());
        this.code = result.getCode();
    }

    public GatewayException(Result result, String message) {
        super(message);
        this.code = result.getCode();
    }

    public GatewayException(String message) {
        super(message);
        this.code = Result.E20001.getCode();
    }

}
